Skip to content

Introduce basic glob support to option handling #2365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 30, 2020
Merged

Conversation

jcollins-g
Copy link
Contributor

It is now possible to create options that understand globs, or port existing options that currently understand only files to understand globs as well.

This PR doesn't actually do matching on globs anywhere (that will be the option user's responsibility), but will properly handle context, config file parsing, and argument/file conflicts to compute a glob that will be matchable.

This is technically a breaking change on the DartdocOption class constructor, however you can change code with a very simple text substitution to get identical behavior so I think it is acceptable given the limited number of potential extenders.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Sep 29, 2020
@jcollins-g jcollins-g marked this pull request as ready for review September 29, 2020 19:25
@@ -433,6 +433,17 @@ class _YamlFileData {
_YamlFileData(this.data, this.canonicalDirectoryPath);
}

/// An enum to specify the multiple different kinds of data an option might
/// represent.
enum OptionDataIs {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptionFormat? OptionKind?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll go with OptionKind, the only other uses we have of kind are pretty far away from here.

@jcollins-g jcollins-g merged commit a1d8f30 into master Sep 30, 2020
@jcollins-g jcollins-g deleted the glob-support branch September 30, 2020 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants